// graph http client
package http

import (
	"code.google.com/p/cloud9lib/restc"
	//"net/url"
	"fmt"
)

type proxy struct {
	m, urlstr string
}

func Model(name, urlstr string) proxy {

	return proxy{name, urlstr}
}

func (p proxy) Add(text string) error {


	params := struct{text string}{text}

	urlstr := fmt.Sprintf("%s/%s/?", p.urlstr, p.m)

	err := restc.Post(urlstr, params, nil)

	return err
}

func (p proxy) Ignore(text string) error {


	params := struct{text string}{text}

	urlstr := fmt.Sprintf("%s/%s/ignore?", p.urlstr, p.m)

	err := restc.Post(urlstr, params, nil)

	return err
}
